package com.yaoyong.yy_demo.config;

import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
public class Swagger3Config {


    @Bean
    public OpenAPI springShopOpenAPI() {
        return new OpenAPI()
                .info(new Info()
                        //大标题
                        .title("Spring Boot中使用Swagger3构建RESTful APIs")
                        // 描述
                        .description("后台API接口")
                        // 版本号
                        .version("v1.0")
                        // 作者
                        .contact(new Contact().name("yaoyong").url("http://localhost:8080/swagger").email("swagger@qq.com"))
                        //许可
                        .license(new License().name("The Apache License, Version 2.0").url("http://www.apache.org/licenses/LICENSE-2.0.html")))
                //外部文档
                .externalDocs(new ExternalDocumentation()
                        .description("官方文档")
                        .url("http://springdoc.org"));
    }

}
